while True:
    num = input("请输入空气质量值：")
    if num == "q":
        print("退出！")
        break
    elif 0 <= int(num) <= 50:
        print("优")
    elif 51 <= int(num) <= 100:
        print("良")
    elif 101 <= int(num) <= 150:
        print("轻度污染")
    elif 151 <= int(num) <= 200:
        print("中度污染")
    elif 201 <= int(num) <= 300:
        print("重度污染")
    else:
        print("严重污染")
    print("-------------------")

